cc.Class({
    extends: cc.Component,
    properties: {
        spBg: {
            default: null,
            type: cc.Sprite
        },
        labString: {
            default: null,
            type: cc.Label
        }
    },
    onLoad: function () {
        Global.notificationCenter.on(Global.eventName.GAME_UPDATE_COMMTIPS_STRING, this.updateStringCallback.bind(this), this),
            this.scheduleOnce(this.timeoutCallback.bind(this), 2);
    },
    start: function () {
    },
    onDestroy: function () {
        Global.notificationCenter.offAll(this);
    },
    updateStringCallback: function (e) {
        if (this.labString && this.spBg) {
            this.labString.string = e;
            var t = this.labString.node.width, n = this.labString.node.height;
            this.spBg.node.width = t + 30, this.spBg.node.height = n + 20;
        }
    },
    timeoutCallback: function (e) {
        this.node.removeFromParent(), this.node.isValid && this.node.destroy(), this.destroy();
    }
})
